package com.example.serviceDriverUser.generator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 自动生成代码工具类
 * @Author lyra
 * @Date 2023/4/12 21:23
 **/
public class MysqlGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-driver-user?characterEncoding=utf-8&serverTimezome=GMT%2B8"
                ,"root"
                ,"000000")
                .globalConfig(builder -> {
                    builder.author("lyra").fileOverride().outputDir("D:\\javacode\\online-taxi-2022-public\\online-taix-public\\service-driver-user\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.example.serviceDriverUser")
                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,
                                    "D:\\javacode\\online-taxi-2022-public\\online-taix-public\\service-driver-user\\src\\main\\java\\com\\example\\serviceDriverUser\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("driver_user_work_status");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
        ;
    }
}
